package me.zhengjie.modules.transformer.history.service.impl;

import me.zhengjie.modules.transformer.history.repository.FdsRecordRepository;
import me.zhengjie.modules.transformer.history.service.FdsRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class FdsRecordServiceImpl implements FdsRecordService {
    @Autowired
    FdsRecordRepository fdsRecordRepository;
    @Override
    public List<Integer> getAllRecordId() {
        List<Integer> allRecordId = fdsRecordRepository.getAllRecordId();
        return allRecordId;
    }

    @Override
    public int getNewRecordId() {
        Integer newRecordId = fdsRecordRepository.findNewRecordId();
        if(newRecordId==null){
            return 1;
        }
        return newRecordId+1;
    }
}
